<template>
    <div class="box">
        <h1>购物车</h1>

        <div class="delect" @click="delect">
           <van-icon name="delete"/>
        </div>
    </div>
</template>

<script>
export default {
  data () {
    return {

    }
  },
  methods: {
    delect () {
      if (this.$store.state.shoppingList.length != 0) {
        this.$bus.$emit('delect_shopping')
      }
    }
  }
}
</script>

<style scoped>
.box {
    width: 100%;
    height: 3rem;
    position: fixed;
    top: 0;
    background-color: white;
    z-index: 99;
}
.box h1{
    line-height: 3rem;
    margin-left: 1rem;
    float: left;
    font-size: 18px;
    color: black;
}
.delect{
    width: 50px;
    line-height: 3rem;
    text-align: center;
    float: right;
}
.delect i{
    line-height: 3rem;
    font-size: 1.75rem;
}
</style>
